# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: Robert Boisvert <rdboisvert@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=sipp
pkgver=3.7.2
pkgrel=0
pkgdesc="Test tool / traffic generator for the SIP protocol"
url="https://github.com/SIPp/sipp"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	cmake
	libpcap-dev
	linux-headers
	lksctp-tools-dev
	ncurses-dev
	openssl-dev>3
	samurai
	"
source="https://github.com/SIPp/sipp/releases/download/v$pkgver/sipp-$pkgver.tar.gz
	libtinfo.patch
	"
options="!check" # tests have no direct target

build() {
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DUSE_PCAP=1 \
		-DUSE_SSL=1 \
		-DUSE_SCTP=1

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -m444 -D pcap/* -t "$pkgdir"/usr/share/"$pkgname"/
}

sha512sums="
5ccd73efe0dd9b9e2788a61c0a423726e3bb7002d1266931838bc18307c975f7cd15b795c1aedb900a7f97a929df4b085b0875914db6e96984bc3bd3952d390b  sipp-3.7.2.tar.gz
92b62f605b92a81ed56ba3f992d126ee70b06f3b08d5c30a3a6614f0844d6ebf1d9e0094ac93dd8c80271414ff414b3efb22117ab2c8eb5ff76fc49327a1dea0  libtinfo.patch
"
